package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/9/22.
 */
@Entity
@Table(name = "wx_pay_notify")
@DynamicInsert
public class WxPayNotify extends BaseEntity{
    private String appid;
    private String openid;
    private String outTradeNo;
    private String arkResult;
    private String tradeNo;
    private String l2rNo;
    @Basic
    @Column(name = "appid", nullable = true, length = 32)
    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    @Basic
    @Column(name = "openid", nullable = true, length = 64)
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "out_trade_no", nullable = true, length = 32)
    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    @Basic
    @Column(name = "ark_result", nullable = true, length = 2)
    public String getArkResult() {
        return arkResult;
    }

    public void setArkResult(String arkResult) {
        this.arkResult = arkResult;
    }
    @Basic
    @Column(name = "trade_no", nullable = true, length = 32)
    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }
    @Basic
    @Column(name = "l2r_no", nullable = true, length = 32)
    public String getL2rNo() {
        return l2rNo;
    }

    public void setL2rNo(String l2rNo) {
        this.l2rNo = l2rNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxPayNotify that = (WxPayNotify) o;

        if (appid != null ? !appid.equals(that.appid) : that.appid != null) return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (outTradeNo != null ? !outTradeNo.equals(that.outTradeNo) : that.outTradeNo != null) return false;
        if (arkResult != null ? !arkResult.equals(that.arkResult) : that.arkResult != null) return false;
        if (tradeNo != null ? !tradeNo.equals(that.tradeNo) : that.tradeNo != null) return false;
        if (l2rNo != null ? !l2rNo.equals(that.l2rNo) : that.l2rNo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = appid != null ? appid.hashCode() : 0;
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (outTradeNo != null ? outTradeNo.hashCode() : 0);
        result = 31 * result + (arkResult != null ? arkResult.hashCode() : 0);
        result = 31 * result + (tradeNo != null ? tradeNo.hashCode() : 0);
        result = 31 * result + (l2rNo != null ? l2rNo.hashCode() : 0);
        return result;
    }
}
